//
//  PhotosViewController.m
//  mafengwo
//
//  Created by Mac on 16/4/7.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "PhotosViewController.h"

@interface PhotosViewController ()

@end

@implementation PhotosViewController

-(id)init{
    self = [super init];
    if (self != nil) {
        self.view.backgroundColor = [UIColor whiteColor];
        self.navigationItem.title = @"相册";
        
        UIButton *backButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
        [backButton setImage:[UIImage imageNamed:@"back_navig.png"] forState:UIControlStateNormal];
        UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
        self.navigationItem.leftBarButtonItem = backItem;
        [backButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];



//    NSLog(@"%@",self.navigationController);

//    self.view.backgroundColor = [UIColor whiteColor];
//    self.navigationItem.title = @"相册";
//    UIButton *backButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 40)];
//    UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:backButton];
//    self.navigationItem.leftBarButtonItem = backItem;
//    [backButton addTarget:self action:@selector(backACtion) forControlEvents:UIControlEventTouchUpInside];
}

-(void)backAction{


    //移除模态视图
    [self dismissViewControllerAnimated:YES completion:^{
//        NSLog(@"移除时执行的代码");

    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
